package com.controller;

import com.domain.User;
import com.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * Created by pengfei on 2017/10/26.
 */
@ResponseBody
@RestController
public class UserController {
    @Autowired
    private UserMapper userMapper;
//    private SqlSessionFactory sqlSessionFactory;

    @RequestMapping("/getUser")
    public List<User> getUser(){
        //List<User> list= userMapper.getUser();
        return null;
    }

    @RequestMapping("/addUser")
    public void addUser(String name){
        User user = new User(name);
        userMapper.addUser(user);
    }
}
